This invention relates generally to data communications networks, and more particularly, to an auto aggregation method for IP prefix/length pairs.
Unicast Internet protocol (IP) subnets are described by an IP prefix and a subnet mask. With the introduction of classless inter-domain routing (CIDR), subnet masks must be contiguous, which allows consistent hierarchical addressing. This allows state requirements for Internet devices to be scalable, as large groups of addresses can be summarized into one entry. Because of the CIDR requirement for contiguous subnet masks, they can be described as an integer, which is the length of the mask.
In certain situations, such as a border gateway protocol (BGP) border, administrators usually configure a summarization of a set of IP subnets to be advertised. This is typically accomplished through manual configuration by an administrator. It is desirable to be able to automatically generate a summary of IP prefix/length pairs for auto-configuration. Situations where this is useful are generally on borders where summarization occurs. Example situations include borders within a given routing protocol, such as open shortest path first (OSPF) area border routers; borders between routing protocols, such as an OSPF or routing information protocol (RIP) border router; borders between autonomous systems, such as BGP-4 border router announce, and special cases such as BGP-4 border router xe2x80x9cblack-holexe2x80x9d routes.
The hard-coded aggregation state of manual configuration typically does not allow optimal path selection in certain scenarios where routes that are part of a summary have gone away. Therefore, there is a need for a way to automatically generate the largest possible set of aggregates given an set of IP prefix/length pairs.
The present invention provides a method, apparatus and article of manufacture for aggregating a sorted list of IP prefix pairs. A prefix pair in the list is compared to a lowest IP length subnet boundary. The prefix pair is added to a final list if the prefix pair is not on the lowest IP length subnet boundary and the prefix pair is not a first in pair. The prefix pair is moved to a next lower length list if the prefix pair is on the lowest IP length subnet boundary and the prefix pair is a next expected pair. A next higher list is selected, and the method is repeated until there are no more lists.